/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: lenovo
 * Date: 2022-09-04
 * Time: 16:40
 */
public class Demo5 {
    public static void main(String[] args) {
        //lambda表达式
        Thread thread =new Thread(()->{}){
            @Override
            public void run() {
                System.out.println("hello thread");
                try {
                    Thread.sleep(1_000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        };
        thread.start();
        while (true){
            System.out.println("hello main");
            try {
                Thread.sleep(1_000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }

}
